<template>
	<Modal v-model="modal" title="查看详情">
		<Form ref="formValidate" :label-width="100">
			<FormItem label='类型:'>
				<span>{{info.typeName}}</span>
			</FormItem>
			<FormItem label='品牌:'>
				<span>{{info.brandName}}</span>
			</FormItem>
			<FormItem label='出厂编号:'>
				<span>{{info.factoryNumber}}</span>
			</FormItem>
			<FormItem label='机时:'>
				<span>{{info.faultDescription}}</span>
			</FormItem>
			<FormItem label='故障描述:'>
				<span>{{info.machine}}</span>
			</FormItem>
			<FormItem label='所需人数:'>
				<span>{{info.requiredNumber}}</span>
			</FormItem>
			<FormItem label='工时报价/小时:'>
				<span>{{info.hoursMoney}}元</span>
			</FormItem>
			<FormItem label='路费总价:'>
				<span>{{info.tripQuotation}}元</span>
			</FormItem>
			<FormItem label='地址:'>
				<span>{{info.address}}</span>
			</FormItem>

			<Tabs active-key="key1" v-if="detailsList">
				<Tab-pane :label="'维修师'+(index+1)" :key="'key'+(index+1)" v-for="(item,index) in detailsList">
					<FormItem label='联系方式:'>
						<span>{{item.detailsTel}}</span>
					</FormItem>
					<FormItem label='维修范围:'>
						<span>{{item.scope}}</span>
					</FormItem>
					<FormItem label='年龄:' v-if="item.age">
						<span>{{item.age}}岁</span>
					</FormItem>
					<div v-if="item.detailsType!=0 && item.detailsType!=1 && item.detailsType!=2">
						<FormItem label='维修师开始时间:'>
							<span>{{item.arriveTime  | timeForm}}</span>
						</FormItem>
						<FormItem label='机主开始时间:'>
							<span>{{item.arriveTimeOwner  | timeForm}}</span>
						</FormItem>
						<div v-if="item.detailsType!=3">
							<FormItem label='维修师结束时间:'>
								<span>{{item.endTime  | timeForm}}</span>
							</FormItem>
							<FormItem label='机主结束时间:'>
								<span>{{item.endTimeOwner  | timeForm}}</span>
							</FormItem>
							<FormItem label='工时:'  v-if="item.workHours">
								<span>{{item.workHours}}小时</span>
							</FormItem>
							<FormItem label='总价格:' v-if="item.totalPrice">
								<span>{{item.totalPrice}}元</span>
							</FormItem>
							<div v-if="item.detailsType!=4">
								<FormItem label='维修报告:'>
									<span>{{item.maintenanceReport}}</span>
								</FormItem>
								<FormItem label='维修结果:'>
									<span>{{item.maintenanceResults}}</span>
								</FormItem>
								<div v-if="item.detailsType!=5">
									<FormItem label='评价信息:'>
										<span>{{item.assessmentInformation}}</span>
									</FormItem>
									<FormItem label='提交时间:'>
										<span>{{item.submitTime | timeForm}}</span>
									</FormItem>
								</div>
							</div>
						</div>
						<!-- <FormItem v-if="item.detailsType==6">
							     <i-button type="primary" @click="apply(item)">支付</i-button>
						</FormItem> -->
					</div>
					
				</Tab-pane>
			</Tabs>

		</Form>
		<div slot="footer">
			<Button @click="cancel">取消</Button>

		</div>
			<!--<applyOpe ref="applyOpe"></applyOpe>-->
	</Modal>

</template>

<script>
	import {
		formatDate
	} from '../utils/time.js'
	export default {
		components: {
		},
		data() {
			return {
				modal: false,
				isEdit: false,
				loadingBtn: false,
				isShow: false,
				insideType: 1,
				refuseReason: '',
				insideId: '',
				hoursMoney1: '',
				tripQuotation1: '',
				detailsList: [],
				detailsId: [],
				su: [],
				info: ''
			}
		},
		methods: {

			show(res) {
				this.$nextTick(() => {
					this.info = res.row;
					this.modal = true
					this.insideId = res.row.insideId
					this.$http.post('maintain/inside/details', {
						id: this.insideId
					}).then(res => {
						if (res.status == 200) {
							if (res.data.code == 200) {
								console.log(res.data.data);
								this.detailsList = res.data.data.detailsList;
							}

						}

					})
				})

			},
			//取消
			cancel() {
				this.modal = false
			},
			modalChange(state) {
				if (state) {

				} else {
					this.$refs.formValidate.resetFields()
				}
			},
			
		}
	}
</script>

<style scoped>
	.ivu-form-item {
		margin-bottom: 1px;
	}
</style>
